import { IParam } from '../../common';
import { IViewAbility } from '../ability/i-view-ability';

/**
 * 视图事件
 *
 * @export
 * @interface IViewEvent
 * @template T
 * @template A
 */
export interface IViewEvent<T, A extends IViewAbility = IViewAbility> {
	/**
	 * 视图行为
	 *
	 * @param {string} name
	 * @param {T} action
	 * @param {IParam[]} data
	 * @memberof IViewEvent
	 */
	viewAction(name: string, action: T, data: IParam[]): void;

	/**
	 * 视图初始化
	 *
	 * @param {string} name
	 * @param {A} data
	 * @memberof IViewEvent
	 */
	viewInit(name: string, data: A): void;

	/**
	 * 视图挂载
	 *
	 * @param {string} name
	 * @param {IParam} data
	 * @memberof IViewEvent
	 */
	viewMounted(name: string, data: IParam): void;

	/**
	 * 视图销毁
	 *
	 * @param {string} name
	 * @param {IParam[]} data
	 * @memberof IViewEvent
	 */
	viewDestroy(name: string, data: IParam[]): void;
}

//  视图事件行为类型
export type ViewActionType = 'viewClose' | 'viewDataSave';

//  首页视图行为参数类型
export type IndexViewActionType = ViewActionType;

// 门户视图行为参数类型
export type PortalViewActionType = ViewActionType;

//  视图行为类型
export type DEViewActionType =
	| 'viewDataLoaded'
	| 'viewDataChange'
	| ViewActionType;

//  编辑视图行为类型
export type EditViewActionType = DEViewActionType;

//  编辑视视图2行为类型
export type EditView2ActionType = DEViewActionType;

//  编辑视视图3行为类型
export type EditView3ActionType = DEViewActionType;

//  编辑视视图4行为类型
export type EditView4ActionType = DEViewActionType;

//  多数据视图行为类型
export type MDViewActionType = DEViewActionType;

//  导航视图行为类型
export type ExpViewActionType = DEViewActionType;

//  表格视图行为参数类型
export type GridViewActionType = MDViewActionType;

//  列表视图行为参数类型
export type ListViewActionType = MDViewActionType;

//  卡片视图视图行为参数类型
export type DataViewActionType = MDViewActionType;

//  看板视图行为参数类型
export type KanBanViewActionType = MDViewActionType;

//  日历视图行为参数类型
export type CalendarViewActionType = MDViewActionType;

//  图表视图行为参数类型
export type ChartViewActionType = MDViewActionType;

//  多表单编辑视图行为类型
export type MEditViewActionType = MDViewActionType;

//  选择视图行为类型
export type PickupViewActionType = DEViewActionType;

//  多项选择视图行为类型
export type MPickupViewActionType = PickupViewActionType;

//  多项选择视图2行为类型
export type MPickupView2ActionType = PickupViewActionType;

//  选项操作视图行为类型
export type OptViewActionType = DEViewActionType;

// 树视图视图行为类型
export type TreeViewActionType = MDViewActionType;

// 树导航视图行为类型
export type TreeExpViewActionType = ExpViewActionType;

// 选择表格视图（部件视图）视图行为类型
export type PickupGridViewActionType = MDViewActionType | 'viewDataActive';

// 分页导航视图行为类型
export type TabExpViewActionType = ViewActionType;

//  表格导航视图行为类型
export type GridExpViewActionType = ExpViewActionType;

//  列表导航视图行为类型
export type ListExpViewActionType = ExpViewActionType;

// 日历导航视图行为类型
export type CalendarExpViewActionType = ExpViewActionType;

//  HTML视图行为类型
export type HtmlViewActionType = DEViewActionType;

// 实体数据看板视图行为类型
export type DEPortalViewActionType = DEViewActionType;

// 自定义视图行为类型
export type CustomViewActionType = DEViewActionType;

// 实体面板视图行为参数类型
export type PanelViewActionType = DEViewActionType;

//  选择树视图（部件视图）行为类型
export type PickupTreeViewActionType = TreeViewActionType | 'viewDataActive';

// 工作流动态选项操作视图行为类型
export type WFDynaActionViewActionType = DEViewActionType;

// 工作流动态编辑视图行为类型
export type WFDynaEditViewActionType = DEViewActionType;

// 工作流动态编辑视图3行为类型
export type WFDynaEditView3ActionType = DEViewActionType;

// 分页搜索视图行为类型
export type TabSearchViewActionType = MDViewActionType;

// 应用流程跟踪视图行为类型
export type WFStepTraceViewActionType = ViewActionType;

// 向导视图行为类型
export type WizardViewActionType = DEViewActionType;

// 登录视图行为类型
export type LoginViewActionType = ViewActionType;

// 应用面板视图行为参数类型
export type AppPanelViewActionType = ViewActionType;

// 应用全局流程工作重定向视图行为参数类型
export type AppWFRedirectViewActionType = ViewActionType;

// 实体重定向视图行为参数类型
export type DERedirectViewActionType = ViewActionType;

//  报表视图行为参数类型
export type ReportViewActionType = MDViewActionType;